package com.bjwl.web.contrlller.admin;

import com.bjwl.pojo.Orders;
import com.bjwl.pojo.Staff;
import com.bjwl.pojo.vo.AdminOrdersQueryVo;
import com.bjwl.service.StaffService;
import com.bjwl.utils.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: dzx
 * @Date:Create：in 2020/4/16 15:16
 * @Description:
 * @Modified By：
 * @Version: 1.0
 */
@Controller
@RequestMapping("/admin/staff")
public class AdminStaffController {

    @Autowired
    private StaffService staffService;

    /**
     * 总店查询员工，分页
     * @param adminOrdersQueryVo
     * @return
     */
    @RequestMapping("/findAllStaff")
    public String findAllStaff(AdminOrdersQueryVo adminOrdersQueryVo, Model model){
        if(adminOrdersQueryVo.getPageNum() == null){
            adminOrdersQueryVo.setPageNum(1);
        }
        PageBean<Staff> pageBean = staffService.findAllStaff(adminOrdersQueryVo);
        model.addAttribute("pageBean",pageBean);
        model.addAttribute("adminOrdersQueryVo",adminOrdersQueryVo);
        return "main_oa/staff-list";
    }

}
